package com.tanglon.listener.read;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.tanglon.domain.dto.ExcelUserDTO;


/**
 * 自定义简单读取监听器
 */

public class SimpleReadListener implements ReadListener<ExcelUserDTO> {
    /**
     * 每读一条数据，就会调用invoke方法
     * @param excelUserDTO
     * @param analysisContext
     */
    @Override
    public void invoke(ExcelUserDTO excelUserDTO, AnalysisContext analysisContext) {
        System.out.println("读取到一条数据: "+excelUserDTO);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("读取完成！");
    }
}
